<?php
define('WSYS_PATH', __DIR__ . DIRECTORY_SEPARATOR);
define('APP_PATH', APP_DIR . DIRECTORY_SEPARATOR .'Application' . DIRECTORY_SEPARATOR);

defined('UNI_BRIDLE') or define('UNI_BRIDLE', true);
define('WSYS_THEME', 'default');
define('ADDON_PATH', APP_DIR . DIRECTORY_SEPARATOR);
define('APP_NAME', basename(dirname(APP_PATH)));
define('WSYS_SYSTEM_PREFIX', 'wsys_');
define('WSYS_PREFIX', WSYS_SYSTEM_PREFIX . APP_NAME . '_');

define('M_SUPPORT', '技术支持：天津指尖云科技有限公司 | 电话：[tel:18911699293](18911699293)');

// app端访问静态资源路径
if(isset($_SERVER['HTTP_HOST'])) {
    $proto = htmlspecialchars((
        (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) ||
        (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') ||
        (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') ||
        (isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') ? 'https://' : 'http://'
    ) . $_SERVER['HTTP_HOST']);
    $web_path = $proto .'/addons/'. APP_NAME .'/Public';
    $lib_path      = $proto .'/addons/wsys_base/Public';
} else {
    $web_path = ADDON_PATH . 'Public';
    $lib_path = ADDON_PATH . '../wsys_base/Public';
}

define('WEB_RESOURCE', $web_path);
define('LIB_RESOURCE', $lib_path);

// 系统静态资源路径，不同网站和app端对应不同的资源路径
define('SYSTEM_RESOURCE', './Public');

include WSYS_PATH . 'Wsys.php';